home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / a_man / cat1 / init.z / init
Encoding:
Text File  |  2002-10-03  |  21.9 KB  |  331 lines

  1.  
  2.  
  3.  
  4. iiiinnnniiiitttt((((1111MMMM))))                                                              iiiinnnniiiitttt((((1111MMMM))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _iiii_nnnn_iiii_tttt, _tttt_eeee_llll_iiii_nnnn_iiii_tttt - process control initialization
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _////_eeee_tttt_cccc_////_iiii_nnnn_iiii_tttt [_0000_1111_2222_3333_4444_5555_6666_SSSS_ssss_QQQQ_qqqq_aaaa_bbbb_cccc]
  13.      _////_eeee_tttt_cccc_////_tttt_eeee_llll_iiii_nnnn_iiii_tttt [_0000_1111_2222_3333_4444_5555_6666_SSSS_ssss_QQQQ_qqqq_aaaa_bbbb_cccc]
  14.  
  15. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  16.    iiiinnnniiiitttt
  17.      _iiii_nnnn_iiii_tttt is a general process spawner.  Its primary role is to create
  18.      processes from information stored in an _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb file (see _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb(4)).
  19.      The default _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb file used is _////_eeee_tttt_cccc_////_iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb; other files can be
  20.      specified using the _IIII_NNNN_IIII_TTTT_TTTT_AAAA_BBBB keyword in the _ssss_yyyy_ssss_tttt_eeee_mmmm file (see _ssss_yyyy_ssss_tttt_eeee_mmmm(4)).
  21.  
  22.      At any given time, the system is in one of eight possible run levels.  A
  23.      run level is a software configuration of the system under which only a
  24.      selected group of processes exist.  The processes spawned by _iiii_nnnn_iiii_tttt for
  25.      each of these run levels is defined in _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb.  _iiii_nnnn_iiii_tttt can be in one of
  26.      eight run levels, _0000_----_6666 and _SSSS or _ssss (run levels _SSSS and _ssss are identical).  The
  27.      run level changes when a privileged user runs _////_eeee_tttt_cccc_////_iiii_nnnn_iiii_tttt.  This user-level
  28.      _iiii_nnnn_iiii_tttt sends appropriate signals to the original _iiii_nnnn_iiii_tttt (the one spawned by
  29.      the operating system when the system was booted) designating the run
  30.      level to which the latter should change.
  31.  
  32.      The following are the arguments to _iiii_nnnn_iiii_tttt.
  33.  
  34.      _0000      Shut the machine down so it is safe to remove the power.  If it
  35.             can, the machine will remove the power provided the kernel power
  36.             removal flag was previously set (as by the command _////_ssss_bbbb_iiii_nnnn_////_uuuu_aaaa_dddd_mmmm_iiii_nnnn
  37.             _2222_5555_6666 _9999).
  38.  
  39.      _1111      Put the system into system administrator mode.  All filesystems
  40.             are mounted.  Only a small set of essential kernel processes run.
  41.             This mode is for administrative tasks such as installing optional
  42.             utilities packages.  All files are accessible and no users are
  43.             logged in on the system.
  44.  
  45.      _2222      Put the system into multi-user state.  All multi-user environment
  46.             terminal processes and daemons are spawned.
  47.  
  48.      _3333      Start the remote file sharing processes and daemons.  Mount and
  49.             advertise remote resources.  Run level _3333 extends multi-user mode
  50.             and is known as the remote-file-sharing state.
  51.  
  52.      _4444      Define a configuration for an alternative multi-user environment.
  53.             This state is not necessary for normal system operations; it is
  54.             usually not used.
  55.  
  56.      _5555      Stop the IRIX system and enter firmware mode.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. iiiinnnniiiitttt((((1111MMMM))))                                                              iiiinnnniiiitttt((((1111MMMM))))
  71.  
  72.  
  73.  
  74.      _6666      Stop the IRIX system and reboot to the state defined by the
  75.             _iiii_nnnn_iiii_tttt_dddd_eeee_ffff_aaaa_uuuu_llll_tttt entry in _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb.
  76.  
  77.      _aaaa,_bbbb,_cccc  Process only those _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb entries for which the run level is set
  78.             to _aaaa, _bbbb, or _cccc.  These are pseudo-states that can be defined to run
  79.             certain commands but do not cause the current run level to change.
  80.  
  81.      _QQQQ,_qqqq    Re-examine _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb.
  82.  
  83.      _SSSS,_ssss    Enter single-user mode.  When the system changes to this state as
  84.             the result of a command, the terminal from which the command was
  85.             executed becomes the system console.
  86.  
  87.             This is the only run level that doesn't require the existence of a
  88.             properly formatted _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb file.  If this file does not exist,
  89.             then by default the only legal run level that _iiii_nnnn_iiii_tttt can enter is
  90.             the single-user mode.
  91.  
  92.             The set of filesystems mounted and the list of processes killed
  93.             when a system enters system state _ssss are not always the same; which
  94.             filesystems are mounted and which processes are killed depends on
  95.             the method used for putting the system into state _ssss and the rules
  96.             in force at your computer site.  The following paragraphs describe
  97.             state _ssss in three circumstances: when the system is brought up to _ssss
  98.             with _iiii_nnnn_iiii_tttt; when the system is brought down (from another state) to
  99.             _ssss with _iiii_nnnn_iiii_tttt; and when the system is brought down to _ssss with
  100.             _ssss_hhhh_uuuu_tttt_dddd_oooo_wwww_nnnn.
  101.  
  102.             When the system is brought up to _ssss with _iiii_nnnn_iiii_tttt, the only filesystem
  103.             mounted is _//// (root).  Filesystems for users' files are not
  104.             mounted.  With the commands available on the mounted filesystems,
  105.             you can manipulate the filesystems or transition to other system
  106.             states.  Only essential kernel processes are kept running.
  107.  
  108.             When the system is brought down to _ssss with _iiii_nnnn_iiii_tttt, all mounted
  109.             filesystems remain mounted and all processes started by _iiii_nnnn_iiii_tttt that
  110.             should be running only in multi-user mode are killed.  Because all
  111.             login related processes are killed, users cannot access the system
  112.             while it's in this state.  In addition, any process for which the
  113.             _uuuu_tttt_mmmm_pppp file has an entry is killed.  Other processes not started
  114.             directly by _iiii_nnnn_iiii_tttt (such as _cccc_rrrr_oooo_nnnn) remain running.
  115.  
  116.             When you change to _ssss with _ssss_hhhh_uuuu_tttt_dddd_oooo_wwww_nnnn, the system is restored to the
  117.             state in which it was running when you first booted the machine
  118.             and came up in single-user state, as described above.  (The
  119.             _pppp_oooo_wwww_eeee_rrrr_dddd_oooo_wwww_nnnn(1M) command takes the system through state _ssss on the way
  120.             to turning off the machine; thus you can't use this command to put
  121.             the system in system state _ssss.)
  122.  
  123.      When an IRIX system is booted, _iiii_nnnn_iiii_tttt is invoked and the following occurs.
  124.      First, _iiii_nnnn_iiii_tttt looks in _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb for the _iiii_nnnn_iiii_tttt_dddd_eeee_ffff_aaaa_uuuu_llll_tttt entry (see _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb(4)).
  125.      If there is one, _iiii_nnnn_iiii_tttt usually uses the run level specified in that entry
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. iiiinnnniiiitttt((((1111MMMM))))                                                              iiiinnnniiiitttt((((1111MMMM))))
  137.  
  138.  
  139.  
  140.      as the initial run level for the system.  If there is no _iiii_nnnn_iiii_tttt_dddd_eeee_ffff_aaaa_uuuu_llll_tttt
  141.      entry in _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb, _iiii_nnnn_iiii_tttt requests that the user enter a run level from the
  142.      virtual system console.  If an _SSSS or _ssss is entered, _iiii_nnnn_iiii_tttt takes the system
  143.      to single-user state.  In the single-user state the virtual console
  144.      terminal is assigned to the user's terminal and is opened for reading and
  145.      writing.  The command _////_ssss_bbbb_iiii_nnnn_////_ssss_uuuu_llll_oooo_gggg_iiii_nnnn is invoked, which prompts the user
  146.      for a root password (see _ssss_uuuu_llll_oooo_gggg_iiii_nnnn(1M)), and a message is generated on the
  147.      physical console saying where the virtual console has been relocated.  If
  148.      _////_bbbb_iiii_nnnn_////_ssss_uuuu_llll_oooo_gggg_iiii_nnnn cannot be found, then _iiii_nnnn_iiii_tttt attempts to launch a shell:
  149.      looking first for _////_bbbb_iiii_nnnn_////_cccc_ssss_hhhh, then for _////_ssss_bbbb_iiii_nnnn_////_ssss_hhhh, then finally for _////_bbbb_iiii_nnnn_////_kkkk_ssss_hhhh.
  150.      Use either _iiii_nnnn_iiii_tttt or _tttt_eeee_llll_iiii_nnnn_iiii_tttt to signal _iiii_nnnn_iiii_tttt to change the run level of the
  151.      system.  Note that if the shell is terminated (via an end-of-file), _iiii_nnnn_iiii_tttt
  152.      only re-initializes to the single-user state if the _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb file does not
  153.      exist.
  154.  
  155.      If a _0000 through _6666 is entered, _iiii_nnnn_iiii_tttt enters the corresponding run level.
  156.      Run levels _0000, _5555, and _6666 are reserved states for shutting the system down.
  157.      Run levels _2222, _3333, and _4444 are available as multi-user operating states.
  158.  
  159.      If this is the first time since power up that _iiii_nnnn_iiii_tttt has entered a run
  160.      level other than single-user state, _iiii_nnnn_iiii_tttt first scans _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb for _bbbb_oooo_oooo_tttt and
  161.      _bbbb_oooo_oooo_tttt_wwww_aaaa_iiii_tttt entries (see _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb(4)).  These entries are performed before
  162.      any other processing of _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb takes place, providing that the run level
  163.      entered matches that of the entry.  In this way any special
  164.      initialization of the operating system, such as mounting filesystems, can
  165.      take place before users are allowed onto the system.  _iiii_nnnn_iiii_tttt then scans
  166.      _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb and executes all other entries that are to be processed for that
  167.      run level.
  168.  
  169.      To spawn each process in _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb, _iiii_nnnn_iiii_tttt reads each entry and for each
  170.      entry that should be respawned, it forks a child process.  After it has
  171.      spawned all of the processes specified by _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb, _iiii_nnnn_iiii_tttt waits for one of
  172.      its descendant processes to die, a powerfail signal, or a signal from
  173.      another _iiii_nnnn_iiii_tttt or _tttt_eeee_llll_iiii_nnnn_iiii_tttt process to change the system's run level.  When
  174.      one of these conditions occurs, _iiii_nnnn_iiii_tttt re-examines _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb.  New entries
  175.      can be added to _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb at any time; however, _iiii_nnnn_iiii_tttt still waits for one of
  176.      the above three conditions to occur before re-examining _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb.  To get
  177.      around this, the _iiii_nnnn_iiii_tttt _QQQQ (or _iiii_nnnn_iiii_tttt _qqqq) command wakes _iiii_nnnn_iiii_tttt to re-examine
  178.      _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb immediately.  Note, however, that if the _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb has been edited
  179.      to change baud-rates, those changes only take effect when new _gggg_eeee_tttt_tttt_yyyy
  180.      processes are spawned to oversee those ports.  Use _kkkk_iiii_llll_llll_aaaa_llll_llll _gggg_eeee_tttt_tttt_yyyy to
  181.      terminate all current _gggg_eeee_tttt_tttt_yyyy processes, then _iiii_nnnn_iiii_tttt _QQQQ to re-examine the
  182.      _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb and respawn them all again with the new baud-rates.
  183.  
  184.      When _iiii_nnnn_iiii_tttt comes up at boot time and whenever the system changes from the
  185.      single-user state to another run state, _iiii_nnnn_iiii_tttt sets the _iiii_oooo_cccc_tttt_llll(2) states of
  186.      the virtual console to those modes saved in the file _////_eeee_tttt_cccc_////_iiii_oooo_cccc_tttt_llll_...._ssss_yyyy_ssss_cccc_oooo_nnnn.
  187.      This file is written by _iiii_nnnn_iiii_tttt whenever the single-user state is entered.
  188.  
  189.      When a run level change request is made _iiii_nnnn_iiii_tttt sends the warning signal
  190.      (_SSSS_IIII_GGGG_TTTT_EEEE_RRRR_MMMM) to all processes that are undefined in the target run level.
  191.      _iiii_nnnn_iiii_tttt waits five seconds before forcibly terminating these processes via
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. iiiinnnniiiitttt((((1111MMMM))))                                                              iiiinnnniiiitttt((((1111MMMM))))
  203.  
  204.  
  205.  
  206.      the kill signal (_SSSS_IIII_GGGG_KKKK_IIII_LLLL_LLLL).
  207.  
  208.      When _iiii_nnnn_iiii_tttt receives a signal telling it that a process it spawned has
  209.      died, it records the fact and the reason it died in _////_vvvv_aaaa_rrrr_////_aaaa_dddd_mmmm_////_uuuu_tttt_mmmm_pppp and
  210.      _////_vvvv_aaaa_rrrr_////_aaaa_dddd_mmmm_////_wwww_tttt_mmmm_pppp if it exists (see _wwww_hhhh_oooo(1)).  A history of the processes
  211.      spawned is kept in _////_vvvv_aaaa_rrrr_////_aaaa_dddd_mmmm_////_wwww_tttt_mmmm_pppp.
  212.  
  213.      If _iiii_nnnn_iiii_tttt receives a _pppp_oooo_wwww_eeee_rrrr_ffff_aaaa_iiii_llll signal (_SSSS_IIII_GGGG_PPPP_WWWW_RRRR) it scans _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb for special
  214.      entries of the type _pppp_oooo_wwww_eeee_rrrr_ffff_aaaa_iiii_llll and _pppp_oooo_wwww_eeee_rrrr_wwww_aaaa_iiii_tttt.  These entries are invoked
  215.      (if the run levels permit) before any further processing takes place.  In
  216.      this way _iiii_nnnn_iiii_tttt can perform various cleanup and recording functions during
  217.      the powerdown of the operating system.
  218.  
  219.    tttteeeelllliiiinnnniiiitttt
  220.      _tttt_eeee_llll_iiii_nnnn_iiii_tttt, which is linked to _////_ssss_bbbb_iiii_nnnn_////_iiii_nnnn_iiii_tttt, is used to direct the actions of
  221.      _iiii_nnnn_iiii_tttt.  It takes a one-character argument and signals _iiii_nnnn_iiii_tttt to take the
  222.      appropriate action.
  223.  
  224. FFFFIIIILLLLEEEESSSS
  225.      _////_eeee_tttt_cccc_////_iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb   default _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb file
  226.      _////_vvvv_aaaa_rrrr_////_aaaa_dddd_mmmm_////_uuuu_tttt_mmmm_pppp
  227.      _////_vvvv_aaaa_rrrr_////_aaaa_dddd_mmmm_////_wwww_tttt_mmmm_pppp
  228.      _////_eeee_tttt_cccc_////_TTTT_IIII_MMMM_EEEE_ZZZZ_OOOO_NNNN_EEEE
  229.      _////_eeee_tttt_cccc_////_iiii_oooo_cccc_tttt_llll_...._ssss_yyyy_ssss_cccc_oooo_nnnn
  230.      _////_dddd_eeee_vvvv_////_cccc_oooo_nnnn_ssss_oooo_llll_eeee
  231.  
  232. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  233.      getty(1M), killall(1M), login(1), powerdown(1M), sh(1), shutdown(1M),
  234.      stty(1), sulogin(1M), uadmin(1M), who(1), kill(2), boot_cpuset(4),
  235.      inittab(4), system(4), timezone(4), utmp(4), termio(7).
  236.  
  237. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  238.      If _iiii_nnnn_iiii_tttt finds that it is respawning an entry from the _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb file more
  239.      than ten times in two minutes, it assumes that there is an error in the
  240.      command string in the entry, and generates an error message on the system
  241.      console.  It then refuses to respawn this entry until either five minutes
  242.      has elapsed or it receives a signal from a user-spawned _iiii_nnnn_iiii_tttt or _tttt_eeee_llll_iiii_nnnn_iiii_tttt.
  243.      This prevents _iiii_nnnn_iiii_tttt from consuming system resources when someone makes a
  244.      typographical error in the _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb file or a program is removed that is
  245.      referenced in _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb.
  246.  
  247.      When attempting to boot the system, failure of _iiii_nnnn_iiii_tttt to prompt for a new
  248.      run level may be because the virtual system console is linked to a device
  249.      other than the physical system console.
  250.  
  251. NNNNOOOOTTTTEEEESSSS
  252.      _iiii_nnnn_iiii_tttt and _tttt_eeee_llll_iiii_nnnn_iiii_tttt can be run only by a privileged user.
  253.  
  254.      The _SSSS or _ssss state must not be used indiscriminately in the _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb file.
  255.      A good rule to follow when modifying this file is to avoid adding this
  256.      state to any line other than the _iiii_nnnn_iiii_tttt_dddd_eeee_ffff_aaaa_uuuu_llll_tttt.
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. iiiinnnniiiitttt((((1111MMMM))))                                                              iiiinnnniiiitttt((((1111MMMM))))
  269.  
  270.  
  271.  
  272.      If a default state is not specified in the _iiii_nnnn_iiii_tttt_dddd_eeee_ffff_aaaa_uuuu_llll_tttt entry in _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb,
  273.      state _6666 is entered.  Consequently, the system loops; that is, it goes to
  274.      firmware and reboots continuously.
  275.  
  276.      If the _uuuu_tttt_mmmm_pppp file cannot be created when booting the system, the system
  277.      boots to state _ssss regardless of the state specified in the _iiii_nnnn_iiii_tttt_dddd_eeee_ffff_aaaa_uuuu_llll_tttt
  278.      entry in the _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb file.
  279.  
  280.      In the event of a file table overflow condition, _iiii_nnnn_iiii_tttt uses a file
  281.      descriptor associated with the _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb file that it retained from the
  282.      last time it accessed that file.  This prevents _iiii_nnnn_iiii_tttt from going into
  283.      single user mode when it cannot obtain a file descriptor to open the
  284.      _iiii_nnnn_iiii_tttt_tttt_aaaa_bbbb file.
  285.  
  286.      The environment for _iiii_nnnn_iiii_tttt and all processes directly started by is set
  287.      initially from a table that is builtin, and then by parsing the file
  288.      _////_eeee_tttt_cccc_////_TTTT_IIII_MMMM_EEEE_ZZZZ_OOOO_NNNN_EEEE.  Lines in that file that are too long are ignored.
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.